//?? 枚举
// enum Direction{
//     up=1,
//     down,
//     left,
//     right
// }
// console.log(Direction.up,Direction.down,Direction.left,Direction.right)
// enum dir {
//     up='up',
//     down='down'
// }
// console.log(dir.up,dir.down)

// enum E {
//     X, Y, Z
// }
// function f(obj: { X: number }) {
//     return obj.X;
// }

// // Works, since 'E' has a property named 'X' which is a number.
// f(E);
enum Enum{
    A
}
let a = Enum.A
let enuma = Enum[a]
console.log(enuma)

const enum Direction{
    up,
    down,
    left,
    right
}
let directions = [Direction.up,Direction.down,Direction.left,Direction.right]
console.log(directions)
let items = [1,2,3]
items.forEach((item,index,array)=>console.log(item))
items.forEach((item)=>console.log(item))
function invoke(args:any[],callback:(...args:any)=>void){
    callback()
}
invoke([1,3],(x?,y?)=>{console.log(x+','+y)})
invoke([1,5],(x,y)=>console.log(x+','+y))